Represents a set of properties that can be iterated, read, or written to an IPropertyStorage instance.
Syntax
Type Parameters
Example
Library/Library.Test/TestPropertySerializer.cs
C# | Copy Code |
---|
PropertySerializer<HaveReadOnly> ser = new PropertySerializer<HaveReadOnly>();
try
{
ser.GetType().InvokeMember("Serialize", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Instance, null,
ser, new object[] { new object(), Dictionary });
}
catch (TargetInvocationException e)
{ Assert.AreEqual(typeof(NotSupportedException), e.InnerException.GetType()); }
try
{
ser.GetType().InvokeMember("Deserialize", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Instance, null,
ser, new object[] { new object(), Dictionary });
}
catch (TargetInvocationException e)
{ Assert.AreEqual(typeof(NotSupportedException), e.InnerException.GetType()); } |
VB.NET | Copy Code |
---|
Dim ser As New PropertySerializer(Of HaveReadOnly)()
Try
ser.[GetType]().InvokeMember("Serialize", System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.InvokeMethod Or System.Reflection.BindingFlags.Instance, Nothing, ser, New Object() {New Object(), Dictionary})
Catch e As TargetInvocationException
Assert.AreEqual(GetType(NotSupportedException), e.InnerException.[GetType]())
End Try
Try
ser.[GetType]().InvokeMember("Deserialize", System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.InvokeMethod Or System.Reflection.BindingFlags.Instance, Nothing, ser, New Object() {New Object(), Dictionary})
Catch e As TargetInvocationException
Assert.AreEqual(GetType(NotSupportedException), e.InnerException.[GetType]())
End Try |
Inheritance Hierarchy
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also